@import '../../src/assets/css/default.less';

@badge-line-height: 32px;
@badge-dot-size: 5px;

// 水平间距
@h-spacing-sm: 5px;
@h-spacing-md: 8px;
@h-spacing-lg: 15px;
// 垂直间距
@v-spacing-xs: 3px;
@v-spacing-sm: 6px;
@v-spacing-md: 9px;
@v-spacing-lg: 15px;
@v-spacing-xl: 21px;

// 图标尺寸
// ---
@icon-size-xxs: 15px;
@icon-size-xs: 18px;
@icon-size-sm: 21px;
@icon-size-md: 22px;       // 导航条上的图标、grid的图标大小
@icon-size-lg: 36px;

@border-width-lg: 2px;



.yh-badge {
    position: relative;
    display: inline-block;
    line-height: @badge-line-height;
    vertical-align: middle;
    margin: 0 5px 0 -10px;
    &-text {
        text-rendering: optimizeLegibility;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        position: absolute;
        top: -1 * @v-spacing-sm;
        height: @icon-size-xs;
        line-height: @icon-size-xs;
        min-width: @icon-size-xs / 2;
        border-radius: 2 * @v-spacing-sm;
        padding: 0 @h-spacing-sm;
        text-align: center;
        font-size: @font-size-caption-sm;
        color: @color-text-base-inverse;
        background-color: @brand-important;
        white-space: nowrap;
        transform: translateX(-45%);
        transform-origin: -10% center;
        z-index: 10;
        font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "\5FAE\8F6F\96C5\9ED1", SimSun, sans-serif;

        a {
            color: @color-text-base-inverse;
        }

        p {
            margin: 0;
            padding: 0;
        }
    }

    &-hot &-text {
        background-color: @brand-hot;
    }

    &-dot {
        position: absolute;
        transform: translateX(-50%);
        transform-origin: 0 center;
        top: -2 * @border-width-lg;
        height: @badge-dot-size; //0.5 * @link-button-font-size;
        width: @badge-dot-size; //0.5 * @link-button-font-size;
        border-radius: 50%;
        background: @brand-important;
        z-index: 10;

        &-large {
            height: @link-button-font-size;
            width: @link-button-font-size;
        }
    }

    &-not-a-wrapper &-text,
    &-not-a-wrapper &-dot {
        top: auto;
        display: block;
        position: relative;
        transform: translateX(0);
    }

    &-corner {
        width: 5 * @link-button-font-size;
        padding: 0.5 * @link-button-font-size;
        position: absolute;
        right: -2 * @link-button-font-size;
        top: 0.5 * @link-button-font-size;
        background-color: @brand-important;
        color: @color-text-base-inverse;
        white-space: nowrap;
        transform: rotate(45deg);
        text-align: center;
        font-size: @font-size-subhead;

        &-wrapper {
            overflow: hidden;
        }
    }
}
